package pwd.allen.behavior.memento;

/**
 *
 *
 * @author 门那粒沙
 * @create 2021-05-23 10:02
 **/
public class Originator {
    private String state;
    public void setState(String state) {
        this.state = state;
    }
    public String getState() {
        return state;
    }
    public Memento createMemento() {
        return new Memento(state);
    }
    public void restoreMemento(Memento m) {
        this.setState(m.getState());
    }
}
